﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SIOCUR.Models;

namespace SIOCUR.Controllers
{
    public class ReporteController : Controller
    {
        SIOCURRepository dbpRepository = new SIOCURRepository();
        
        //
        // GET: /Reporte/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult CondicionesOperativas()
        {
            var condiciones = dbpRepository.getConditions().ToList();
            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();
            return View(condiciones);
        }

        public ActionResult IntegradoLote()
        {
            var integradoLote = dbpRepository.GetIntegratedBatchs().ToList();
            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();
            return View(integradoLote);
        }

        public ActionResult EquipoDinAux()
        {
            //var equipoDinamico = dbpRepository.FindAllEqDinam().ToList();
            //return View(equipoDinamico);

            ViewData["equipoDinamico"] = dbpRepository.GetEqDinams().ToList();

            ViewData["equipoAuxiliar"] = dbpRepository.GetEqAuxiliars().ToList();

            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();
            return View();

        }

        public ActionResult RastreoLote()
        {
            var rastreoLote = dbpRepository.GetRastreoLotes().ToList();
            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();
            return View(rastreoLote);
        }

        public ActionResult LoteIntegInterf()
        {
            ViewData["integradoLote"] = dbpRepository.GetIntegratedBatchs().ToList();

            ViewData["interfaseLote"] = dbpRepository.GetInterfaseLotes().ToList();

            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();
            
            return View();
        }
        
        public ActionResult VariacionPresiones()
        {
            var rastreoLote = dbpRepository.FindAllRastreoLote().ToList();

            ViewData["hoy"] = DateTime.Now.ToShortDateString().ToString();

            return View(rastreoLote);
        }
    }
}
